The present invention relates to a data consistency memory management system and method, as well as to a corresponding multiprocessor network.
Fast processors clocked at speeds of more than 100 MHz generally use cache memories, also referred to simply as caches, to be able to operate efficiently. Such a cache duplicates some of the data present in main memory (such as a synchronous access memory or SDRAM), over to a memory offering a much faster access time than the latter. In a conventional system, the cache is limited in size for reasons of cost and bulk, and only a small part of the main memory lies in the cache at a given time. In improved systems, several levels of caches are cascaded, each level being specified by the time to access a data item and by its storage capacity. Customarily, the first cache level allows access to data at the speed of the processor.
A difficulty appears in a so-called multimaster environment, where several processors use the same main memory. Specifically, data consistency must then be ensured between the main memory and the cache or the caches, both in read and write mode, with no risk of overwriting information.
This is especially salient in a so-called xe2x80x9cwrite-backxe2x80x9d cache mode. In such a mode, writes are performed by the associated processor directly to the cache and are carried over into main memory only during operations for updating the data of the cache (dumping or flush), whereas in a so-called xe2x80x9cwrite-throughxe2x80x9d cache mode, writes are on the contrary carried over in real time from the cache to the main memory. The write-back mode is distinguished by its efficiency, since it requires a smaller frequency of transfers between the cache and the main memory. However, the consistency of the data between the cache and the main memory is not ensured at all times. The reading of data from the main memory by a processor other than that associated with the cache currently being used therefore poses a problem.
Another problem, existing in both write-back and write-through modes, relates to the writing of data in main memory by a processor, when a cache is currently being used by another processor. When transferring information from the cache to the main memory, the data registered in the latter memory is in fact at risk of being overwritten.
Several solutions are currently used to remedy these difficulties, relying on hardware or software means. They guarantee that at any instant, memory data belongs to just one of the masters. The hardware means guaranteeing the consistency of data (such as the so-called xe2x80x9csnoopxe2x80x9d technique) customarily implement complex solutions, in which any master accessing a data item in main memory must be sure that a subassembly furnished with a cache does not possess the data item before manipulating it. If such is the case, the data item is made available to the main memory or to the master by a memory write mechanism. In addition to their complexity and cost of installation, these systems require that passbands be allocated to the processors. They penalize the processing times through holdups.
The software means guaranteeing the consistency of data customarily compel segmented management of the data, that is to say management organized in such a way that each master is furnished with one or more dedicated memory spaces and with a shareable memory area. The memory spaces dedicated to a master can be accessed only by the caches associated with this master, the data not being shared therein with other masters, whilst the shareable memory area cannot be accessed by the caches and serves as data exchange area. Another software means of ensuring the consistency of data implements specific processor instructions for managing caches, capable of manipulating cache data blocks so as to ensure the consistency of this data between caches and main memory. This means also compels data management organized so as to take account of the size of the data blocks manipulated by these instructions, in such a way as to preclude different masters from accessing the same data blocks through write operations (risk of overwriting).
In all cases these software techniques require precise synchronization and an initial overall design incorporating constraints related to the multiprocessor operation of the system. Moreover, they require that there be made available in each of the processors, management programming adapted to the exchanges of data between caches and the main memory within all the processors.
The present invention relates to a system for memory management of data consistency relating to a main memory accessible by at least two processors, making it possible to ensure consistency between caches of one or more processors and the main memory. The memory management system of the invention can ensure this consistency in read and/or write mode in the main memory, and permits reliable, economic and easy installation and implementation, in regard to the existing methods. In particular, it offers these advantages when the multiprocessor operation results from an upgrade of a monoprocessor system. Moreover, it can yield high processing speeds, as compared with the known hardware means.
The invention also pertains to a multiprocessor network incorporating a memory management system according to the invention and to a data consistency memory management method, having the advantages cited above.
It applies in particular to the audiovisual field, especially for digital decoders.
To this end, the subject of the invention is a system for memory management of data consistency relating to a main memory accessible by at least two processors. At least one of these processors is furnished with one or more cache memories associated with at least one area of the main memory, referred to as the assignment area of this processor. The management system comprises:
an assembly for management of access of the processors to at least one common area of the main memory, referred to as the exchanges area,
one or more copy modules respectively associated with one or more of the processors furnished with at least one cache memory, hereinafter designated as first processors; each of these copy modules is capable of performing a data copy between a memory workspace consisting of one of the cache memories and/or the assignment area of the associated first processor, on the one hand, and the exchanges area, on the other hand,
and one or more data transfer modules, associated respectively with one or more second processors capable of exchanging data with the first processors; each of these transfer modules is intended for transferring data between the exchanges area and the associated second processor.
According to the invention, the consistency management system also comprises triggering means controlled by the second processors, capable of triggering the copy modules of the first processors and the transfer modules of the second processors when the first processors submit requests involving transfers of data between the memory workspaces of the first processors and the second processors.
The expressions xe2x80x9ccopy modulexe2x80x9d and xe2x80x9ctransfer modulexe2x80x9d are not intended to be understood as specified physical objects, but as functional entities which may for example be grouped together and integrated physically into one or more hardware supports, or on the contrary each dispersed in several supports.
The expression xe2x80x9cdataxe2x80x9d may be understood equally well, in particular, as references to data in memory and as command identifiers.
The memory workspace used by the copy module is that active during the reading or writing of data. Thus, when the data exchanged with a first processor is present in cache, it is the latter which serves as point of departure in read mode and as point of arrival in write mode. When conversely the targeted data is in a memory space of the assignment area which is not utilized in cache, the data is read or written directly from or to this assignment area of the main memory. In all cases the first processor is itself capable of extracting or of placing the data required, according to procedures internal to its cache management operation. In this way, operations for copying to or from the exchanges area pose no difficulty and enable the transfers with a second processor be carried over to the exchanges area.
The processors with cache memories are therefore furnished with a cache or with several caches in cascade, the latter embodiment posing no particular difficulty.
One or more of the processors fitted with cache memories may benefit from the consistency management characteristics of the invention. Preferably, the consistency memory management system assigns these characteristics to all the processors with cache memories. In variant embodiments, only some of these processors benefit therefrom, the others using as necessary other means for managing consistency. The processors with cache memories furnished with the consistency management capabilities of the invention may therefore sometimes play the role of xe2x80x9cfirst processorsxe2x80x9d and sometimes that of xe2x80x9csecond processorsxe2x80x9d.
Thus, the memory management system of the invention relies on systematic passing through the exchanges area of all the information to be exchanged (in read mode and/or in write mode) between a first processor furnished with cache management and a second processor, with or without a cache, which passing is controlled by the second processor.
By contrast, in the known techniques with hardware means, the information is read or written directly by the second processor from or to the assignment area of the first processor in main memory, after the assignment area and the cache (or caches) are made consistent. This update prior to any exchange has drawbacks mentioned above. Additionally, in the known techniques with software means, the information to be shared must previously be allocated in an exchanges area of the main memory, or rely on successive changes of assignment of areas of the main memory. In all cases, overall coordination is required and the individual management of each of the processors with cache memory must be adapted accordingly. Specifically, each transfer of data between one of the processors and the exchanges area is initiated by this processor, so that a transfer between two processors necessarily involves the respective means of management of these processors.
It turns out that these drawbacks are overcome by the memory management system of the invention. In particular, by virtue of the carrying over of the transfers to the exchanges area, the memory management system circumvents the difficulties related to the internal management of each processor provided with cache memories. Moreover, the difficulties of design and of synchronization of the prior art with software means are overcome, since a data transfer between two processors is controlled entirely by one of the two processors, on the basis of a request formulated initially by the other processor.
The system of the invention turns out to be particularly beneficial when it is applied to a first processor designed originally to operate in monoprocessor mode with cache memories. It would in fact be complex to adapt the programming in this processor and this would incur substantial risks of errors. The invention makes it possible to couple this first processor to a second processor (or more), merely by supplementing this first processor with a programming layer for copying data between its memory workspace and the exchanges area. The control of all the transfer operations is in fact carried over to the second processor, for which specific memory management software is developed.
The copying and transfer which are mentioned target:
either a copying of a cache or of an assignment area of one of the first processors to the exchanges memory, and a transfer from the exchanges memory to one of the second processors; the capabilities of the copy modules and transfer modules and of the triggering means then correspond to a reading by the second processor, of data accessible by the first processor; this characteristic makes it possible to ensure in write-back mode read-consistency of data processed by the first processor (this memory consistency is ensured automatically in write-through mode);
or a transfer from one of the second processors to the exchanges memory and a copy from the exchanges memory to a cache or an assignment area of one of the first processors; the capabilities of the copy modules and transfer modules and of the triggering means then correspond to a writing by the second processor, of data accessible by the first processor; this characteristic makes it possible to ensure, in both write-back mode and write-through mode, write-consistency of data which is to be processed by the first processor;
or both (consistency capability in both directions).
The triggering means advantageously comprise instruction reading means installed in the various processors in software form, capable of reading and of interpreting requests transmitted by other processors, preferably in the exchanges area.
In a first advantageous form of memory allocation, the second processors are fitted with memory space allocation modules, capable of allocating common spaces in the exchanges area. The triggering means are then capable of triggering the memory space allocation modules when the first processors submit requests involving transfers of data between the memory workspaces of the first processors and the second processors, by bringing about the allocation of the common spaces necessary for this data. The memory management system can thus restrict accesses of the first processors to the exchanges memory, permitting only copy accesses (in read mode and/or in write mode).
In a second form of memory allocation, the first processors are fitted with memory space allocation modules, capable of allocating common spaces in the exchanges area. The triggering means (controlled by the second processors) are then capable of triggering these memory space allocation modules under the same circumstances as before. Thus, the first processors retain mastery of the allocations of space in the exchanges memory when these allocations are concerned with their memory workspaces, but under the supervision of the second processors.
Preferably, the triggering means comprise at least one interrupt device between the first processors and second processors capable of exchanging data, said device being intended to signal an exchange of data between these processors and to bring about a temporary interruption of processing operations in progress in these processors. Such an interrupt device linking one of the first and one of the second processors advantageously has the effect of bringing about a reading of the exchanges area by the second processor, after the first processor has registered therein a request executable by the second processor, and vice versa. This request may pertain in particular to a processing operation using data, an allocation of memory space in the exchanges memory, a data copy to or from this exchanges memory by the first processor, and/or a transfer operation between the exchanges memory and the second processor.
The interrupt devices advantageously comprise hardware mechanisms.
According to a first preferred embodiment of the copy and transfer modules (reading of data accessible by a processor with cache memory), the copy module of at least one of the first processors is designed to perform a data copy from the exchanges area to the memory workspace of the first processor and the transfer modules of the second processors capable of exchanging data with the first processor are designed to transfer data from the second processors to the exchanges area.
According to a second preferred embodiment of the copy and transfer modules (writing of data rendered accessible by a processor with cache memory), the copy module of at least one of the first processors is designed to perform a data copy from the memory workspace of the first processor to the exchanges area and the transfer modules of the second processors capable of exchanging data with the first processor are designed to transfer data from the exchanges area to the second processors.
Advantageously, the two embodiments are combined. More precisely, the capabilities of the first embodiment (reading) are preferably installed for all the processors having write-back cache memory management, and those of the second embodiment (writing), for all the processors with cache memory (in write-through and write-back mode). However, the consistency memory management system advantageously applies both in read and write mode to all the processors with cache memory, since its systematic installation makes it possible to use the same software functions in all these processors at the cost of minimal adaptations. In variant embodiments, the first embodiment (reading) is implemented without the second. The write-consistency capabilities are then ensured by other means, such as for example a cache memory management module capable of automatically reupdating as necessary the cache memory used with respect to the exchanges memory, when writing to the latter.
In a first embodiment of the management of shared access, the assignment areas of the processors with cache memories being outside the exchanges area, the assembly for management of shared access to the exchanges area is designed for a non-hidden area.
In a second embodiment of the management of shared access, at least one of the assignment areas of the processors with cache memories containing the exchanges area, the assembly for management of shared access to the exchanges area comprises a hardware device capable of ensuring the consistency of the said exchange area. The exchange area is thus hidden but consistent.
The invention also applies to a multiprocessor network comprising a main memory and at least two processors, at least one of the processors being furnished with a cache memory associated with at least one area of the main memory, referred to as the assignment area of the processor.
This multiprocessor network is characterized in that it comprises a data management system in accordance with the invention.
The invention also relates to a method for memory management of data consistency relating to a main memory accessible by at least two processors. At least one of these processors is furnished with one or more cache memories associated with at least one area of the main memory, referred to as the assignment area of the processor. In the method, the shared access of the processors to at least one common area of the main memory, referred to as the exchanges area, is managed in such a way that during a transfer of data from at least a first of the processors furnished with one or more cache memories to a second of the processors,
a copying of this data from a memory workspace consisting of one of the cache memories and/or the assignment area of the first processor, to the exchanges area is triggered, and
a transfer of this data from the exchanges area to the second processor is triggered, and/or during a transfer of data from the second processor to the first processor:
a transfer of this data from the second processor to the exchanges area is triggered, and
a copying of this data from the exchanges area to the memory workspace of the first processor is triggered.
According to the invention, when a request involving a transfer of data from the memory workspace of the first processor to the second processor is sent by means of the first processor and/or when a request involving a transfer of data from the second processor to the memory workspace of the first processor is sent by means of the first processor, the copying and the transfer of the data are triggered by means of the second processor.